<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
//数组：一组数据
let arr =[45,78,56,344,-67,0];
console.log(arr[2]);//56
console.log(arr);//打印整个对象object
//遍历数组
for (let i=0;i<arr.length;i++){
    console.log (arr[i]);
}
//找出成绩scor中最高分，并求平均分数。score[45,78,89,94,63,55,80,74]
let score=[45,78,89,94,63,55,80,74];
let sum=0,avg;
let max=score[0];
for (let i=1;i<score.length;i++){
    sum+=score[i];
    if (score[i]>max){
        max=score[i];
    }
}
avg=sum/score.length;
console.log('最大值是：'+max);
console.log(avg);
console.log(score.length);
score[47]=90;
console.log(score.length);
console.log(score);
delete score[47];
console.log(score);




</script>
</html>